How do I move via Powershell all folders & mail in say "Inbox" to a folder called "archive" under Managed Folders?
We have used the Quest tool to migrate our users from Groupwise to Exchange 2007 and during the migration we put all the "archived" emails from group into a folder called "groupwise archives" in their Outlook 2007. This was fine during the interim migration, but now we want to move the contents (new folders and mail) under the main folder called "Groupwise Archive" to a managed folder called "Archive" under Managed Folders for so 200 users in the compnay. Is there a Powershell script or command that I can run that will do this for me? Thansk for any help. Capt
February 8th, 2008 6:59pm

Does anyone have any ideas on this? I'm in a similar situation and may need to do this. Thanks Will
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2008 8:45pm

Since I couldn't find this anyplace I ended up writting my own vbs script to do this. ' ********************************************************' MoveFolders 1.0 '' Used to move all mail and sub folders from a folder in the root ' of the mailbox to under a Managed Folder. ' ' Written by Will Shepherd' ********************************************************* Const olFolderInbox = 6 Set objOutlook = CreateObject("Outlook.Application")Set objNamespace = objOutlook.GetNamespace("MAPI")objNameSpace.Logon ("Profile Name")Set objInbox = objNamespace.GetDefaultFolder(olFolderInbox) strFolderName = objInbox.Parent Set objMailbox = objNamespace.Folders(strFolderName) Set objold = objMailbox.Folders("Original Folder")Set objNew = objMailbox.Folders("Managed Folders")Set objNewsub = objNew.Folders("New Folder") Wscript.Echo "Old Folder: " & objold.NameWscript.Echo "New Folder: " & objNew.Name & "\" & objNewSub.NameWscript.Echo Set colItems = objold.Items For i = colItems.Count to 1 Step - 1 colItems(i).Move objNewSubNext GetSubfolders(objold) GetSubfolders(objold) objold.DeleteWscript.EchoWscript.Echo "Original Folder has been deleted" Sub GetSubfolders(objParentFolder) Set colFolders = objParentFolder.Folders For Each objFolder in colFolders Set objSubfolder = objParentFolder.Folders(objFolder.Name) Wscript.Echo objFolder.NameobjFolder.MoveTo ObjNewSub NextEnd Sub
May 16th, 2008 11:28pm

Will,This looks good but how woudl it work in production? do you have fields where I can insert the name say everything under the directory called "Groupwise Archive"andmoveit under "Managed Folders-->Archive"mail user | |----Groupwise Archive| || |----My Folders| |||---My files | |----Managed Folders | |--Archive
Free Windows Admin Tool Kit Click here and download it now
May 12th, 2009 10:00pm

Hello,You would like to check this thread for the same.http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/ebace449-7269-4a14-9649-09624c3cf364Arun Kumar | MCSE - 2K3 + Messaging | ITIL-F V3
May 12th, 2009 10:40pm

I'm a little sketchy on on this link. Nuno said he has never tried his own script and was not sure if it will work, therefore I am unsure of his script is what I need. It looks OK for a structure standpoint, but I would like to see how my fields above fit into his script.Capt.
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2009 10:13pm

Hi Morgan,I was going to test this command for your situation but remembered that the Export-Mailbox cannot be used when the source and target mailbox are the same... But it would be perfect for this case.I'm thinking on another way to do this...Nunohttp://LetsExchange.blogspot.com
May 27th, 2009 8:39pm

Nuno, The source mailbox and destination mailbox are the same user. Thisis why I think it would be an involved script if you can make it work. Like I said we just need to move 1000+ users archives from one folder to another and if i can get a good script to make this work I would be very appreciative. mail user | |----Groupwise Archive (Thisis the original location of the files and folders)| || |----My Folders| |||---My files | |----Managed Folders | |--Archive (move everything under Groupwise Archive to this folder)Thanks for your helpCapt.
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2009 8:52pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics